def main():
    fp = open('data')
    prevline = ''
    while 1:
        currlinestr = fp.readline()
        print 'Step %s'
        if currlinestr:
            currline = [int(x) for x in currlinestr.split()]
            if prevline == '':
                prevline = currline
            else:
                length = len(currline)
                prevlinenew = [0]*length
                prevlinenew[0] = currline[0] + prevline[0]
                for i in range(1,length-1):
                    m = max(prevline[i-1], prevline[i])
                    prevlinenew[i] = currline[i] + m
                # print 'after for',prevlinenew
                prevlinenew[length-1] = prevline[length-2] + currline[length-1]
                prevline = prevlinenew
                # print prevline
        else:
            print 'the result is:',max(prevline)
            return
main()
